package com.wwj.study.singleton.serial;

import com.sun.xml.internal.messaging.saaj.util.ByteOutputStream;

import java.io.*;

/**
 * Created by lenovo on 2018/11/15.
 */
public class Serial {

    public static void main(String[] args) {
        SerialInfo serial=new SerialInfo();
        System.out.println(serial);
        try {
            FileOutputStream fileOutputStream=new FileOutputStream("oss");
            ObjectOutputStream objectOutputStream=new ObjectOutputStream(fileOutputStream);
            objectOutputStream.writeObject(serial);

            FileInputStream fileInputStream=new FileInputStream("oss");
            ObjectInputStream objectInputStream=new ObjectInputStream(fileInputStream);
            SerialInfo Serial1= (SerialInfo)objectInputStream.readObject();

            System.out.println(Serial1);

        } catch (Exception e) {
            e.printStackTrace();
        }



    }


}
